#include "AutoCorrelation.h"

std::vector<double> autocorr(const std::vector<double>elem, const int iTtotal) {
	std::vector<double> acf(iTtotal);
	for (int k = 0; k < iTtotal; k++) {
		for (int i = 0, j = k; j < iTtotal; i++, j++) {
			acf[k] += elem[i] * elem[j];
		}
		acf[k] /= iTtotal - k;
	}
	return acf;
}